package com.ct.lotterysystem2.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ct.lotterysystem2.dao.dataobject.ActivityPrizeDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ActivityPrizeMapper extends BaseMapper<ActivityPrizeDO> {
    @Insert("<script>" +
            " insert into activity_prize" +
            " (activity_id, prize_id, prize_amount, prize_tiers, status)" +
            " values <foreach collection='items' item='item' separator=','>" +
            " (#{item.activityId}, #{item.prizeId}, #{item.prizeAmount}, #{item.prizeTiers}, #{item.status})" +
            " </foreach>" +
            " </script>")
    int batchInsert(@Param("items") List<ActivityPrizeDO> activityPrizeDOList);
}
